package IDS;

use strict;

use Utils;

use Host;

use base qw (NetworkDB);

__PACKAGE__->set_up_table('ids');
__PACKAGE__->has_many(segments => 'Segment');


sub initialize {
	my $self = shift;
}

sub command {
	my $self = shift;
	my ($command) = @_;
	my $user = $self->default_user;
	my $IP = $self->mgmt_ip;
#	print "sudo -u $user ssh $user\@$IP '$command'";
	my @output_lines = `sudo -u $user ssh $user\@$IP '$command'`;
	return @output_lines;
}

sub send_file {
        my $self = shift;
        my ($src_local_file, $dst_remote_file) = @_;
#	if (($dst_remote_file eq undef) || !$dst_remote_file) {
#		$dst_remote_file = $src_remote_file;
#	}
        my $user = $self->default_user;
        my $IP = $self->mgmt_ip;
        my @output_lines = `sudo -u $user scp -r $src_local_file $user\@$IP\:$dst_remote_file`;
        return @output_lines;
}

1;
